/*
 *  This file is part of WWWPal.
 *
 *  Copyright (C) 2003  Dr. John Punin, Department of Computer Science
 *  Rensselaer Polytechnic Institute
 *
 *  WWWPal is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  WWWPal is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Foobar; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#ifndef LOGR_CONFIGURATION_H
#define LOGR_CONFIGURATION_H

#include <sys/stat.h>
#include <sys/fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <ctype.h>
#include <sys/time.h>
#include <assert.h>
#include <gr_graph_fun.h>

typedef struct _output_file_node {
    int i;
    int nele;
    int nkey;
    int ngraph;
    int nus;
    int min_edges;
    int max_edges;
    char *lml_name;
    char *rep_prefix;
    char *rep_dir;
} OutputFileNodeStruct;

typedef struct _output_file_node *OutputFileNodePtr;

typedef struct _config_node {
    char *ws_uri;
    char *ws_domain;
    int nsn;
    LNode_type *lws_subnets;
    char *lf_name;
    char *lf_uri_prefix;
    char *lf_prefix;
    char *lf_root_dir;
    short lf_type;
    short cus;
    short lf_rhip;
    int lf_rhipt;
    char *gf_name;
    int nof;
    LNode_type *lout_files;
} ConfigNodeStruct;

typedef struct _config_node *ConfigNodePtr;

ConfigNodePtr
new_config_node(void);

void
delete_config_node(ConfigNodePtr con);

void
LOGR_set_config_webserver_uri(ConfigNodePtr con, char *wsu);

char *
LOGR_get_config_webserver_uri(ConfigNodePtr con);

void
LOGR_set_config_webserver_domain(ConfigNodePtr con, char *wsd);

char *
LOGR_get_config_webserver_domain(ConfigNodePtr con);

void
LOGR_set_config_logfile_name(ConfigNodePtr con, char *lfn);

char *
LOGR_get_config_logfile_name(ConfigNodePtr con);

void
LOGR_set_config_logfile_prefix(ConfigNodePtr con, char *lfp);

char *
LOGR_get_config_logfile_prefix(ConfigNodePtr con);

void
LOGR_set_config_logfile_uri_prefix(ConfigNodePtr con, char *lfup);

char *
LOGR_get_config_logfile_uri_prefix(ConfigNodePtr con);

void
LOGR_set_config_logfile_root_dir(ConfigNodePtr con, char *lfrd);

char *
LOGR_get_config_logfile_root_dir(ConfigNodePtr con);

void
LOGR_set_config_logfile_type(ConfigNodePtr con, short lft);

short
LOGR_get_config_logfile_type(ConfigNodePtr con);

void
LOGR_set_config_logfile_res_ip(ConfigNodePtr con, short rhip);

short
LOGR_get_config_logfile_res_ip(ConfigNodePtr con);

void
LOGR_set_config_logfile_res_ip_timeout(ConfigNodePtr con, int rhipt);

int
LOGR_get_config_logfile_res_ip_timeout(ConfigNodePtr con);

short 
LOGR_get_config_compute_user_sessions(ConfigNodePtr con);

short 
LOGR_get_config_compute_user_sessions(ConfigNodePtr con);

void
LOGR_set_config_compute_user_sessions(ConfigNodePtr con);

void
LOGR_reset_config_compute_user_sessions(ConfigNodePtr con);

void
LOGR_set_config_graphfile_name(ConfigNodePtr con, char *gfn);

char *
LOGR_get_config_graphfile_name(ConfigNodePtr con);

LNode_type *
LOGR_get_config_list_subnet(ConfigNodePtr con);

int
LOGR_get_config_num_subnet(ConfigNodePtr con);

void
LOGR_add_config_subnet(ConfigNodePtr con, char *cidr);

int
LOGR_get_config_num_output_files(ConfigNodePtr con);

OutputFileNodePtr
LOGR_add_output_file(ConfigNodePtr cnp, int nelements, int nkeywords);

void
LOGR_set_logmlfile_name(OutputFileNodePtr ofn, char *lml_name);

void
LOGR_set_report_prefix_name(OutputFileNodePtr ofn, char *rp);

void
LOGR_set_report_directory_name(OutputFileNodePtr ofn, char *dir);

void
LOGR_set_user_session(OutputFileNodePtr ofn,int num_users, int num_graphs, 
		      int min_edges, int max_edges);

int 
LOGR_get_config_nelements(ConfigNodePtr con,int i);

int 
LOGR_get_config_nkeywords(ConfigNodePtr con,int i);

char *
LOGR_get_config_logml_file(ConfigNodePtr con,int i);

char *
LOGR_get_config_report_prefix(ConfigNodePtr con,int i);

int
LOGR_get_config_num_users(ConfigNodePtr con,int i);

int
LOGR_get_config_max_edges(ConfigNodePtr con,int i);

int
LOGR_get_config_min_edges(ConfigNodePtr con,int i);

int
LOGR_get_config_num_graphs(ConfigNodePtr con,int i);

char *
LOGR_get_config_report_dir(ConfigNodePtr con,int i);

#endif



